package com.skit.common.ktx

import android.content.res.Resources
import android.util.TypedValue


val Float.dp: Int
    get() = (TypedValue.applyDimension(
        TypedValue.COMPLEX_UNIT_DIP,
        this,
        Resources.getSystem().displayMetrics
    ) + 0.5f).toInt()

val Int.dp: Int
    get() = (TypedValue.applyDimension(
        TypedValue.COMPLEX_UNIT_DIP,
        this.toFloat(),
        Resources.getSystem().displayMetrics
    ) + 0.5f).toInt()

val Float.sp
    get() = (this * Resources.getSystem().displayMetrics.scaledDensity)

val Int.sp
    get() = (this * Resources.getSystem().displayMetrics.scaledDensity)

